<div class="container">
  <div class="row row-cards row-deck mt-md-5">

    <div class="col-md-3">
      <%= render "_sidebar.html", assigns %>
    </div>

    <div class="col-md-9">
      <div class="card profile">
        <div class="card-body p-6 clearfix">
          <div class="btn-list float-right">
          <a href="<%= Routes.post_path(@conn, :edit, @post) %>" class="btn btn-secondary btn-sm"> <i class="fe fe-edit-2"></i> <%= gettext "Edit" %> </a>
          <a href="<%= ChubiWeb.Router.Helpers.preview_path(@conn, :show_post, @post) %>" class="btn btn-secondary btn-sm"> <i class="fe fe-eye"></i> <%= gettext "Preview" %> </a>
          </div>

          <h2 class="fw-bold mb-0"><%= @post.title %></h2>
          <span class="text-muted"><%= @post.slug %></span>

          <div class="field-list mt-5">
            <div class="field p-0">
              <div class="field-name fw-bold"><%= gettext "Categories" %></div>
              <div class="field-value">
                <%= for cat <- @post.categories do %>
                  <span class="badge badge-secondary mr-1">
                    <%= cat.name %>
                  </span>
                  <% end %>
              </div>
            </div>

            <div class="field p-0">
              <div class="field-name fw-bold"><%= gettext "Tags" %></div>
              <div class="field-value">
                <%= for tag <- @post.tags do %>
                  <span class="badge badge-secondary mr-1">
                    <%= tag.name %>
                  </span>
                <% end %>
              </div>
            </div>

            <div class="field p-0">
              <div class="field-name fw-bold"><%= gettext "Status" %></div>
              <div class="field-value">
                <%= if @post.draft do %>
                  <span class="badge-status badge-secondary">
                    <%= gettext "Draft" %>
                  </span>
                <% else %>
                  <span class="badge-status badge-success">
                    <%= gettext "Published" %>
                  </span>
                <% end %>

              </div>
            </div>

            <div class="field p-0">
              <div class="field-name fw-bold"><%= gettext "Date" %></div>
              <div class="field-value">
                <%= format_date(@post.date) %>
              </div>
            </div>
          </div>

          <div class="bd-t mt-7 p-5 pt-7">
            <%= raw @post.html_content %>
          </div>

          <div class="mt-7">
            <a href="<%= Routes.post_path(@conn, :edit, @post) %>" type="submit" class="btn btn-secondary"> <i class="fe fe-edit-2 mr-1"></i><%= gettext "Edit" %></a>
          </div>

        </div>
      </div>
    </div>

  </div>
</div>




